#include <iostream>
#include <queue>
#include <vector>

using namespace std;

typedef long long LL;

int n,k;
priority_queue<int> heap;


int main()
{
    cin >> n >> k;
    LL sum = 0;
    
    while(n--)
    {
        int x; cin>> x;
        sum += x;
        if(x % 2== 0)
        heap.push(x);
    }

    while(heap.size() && k--)
    {
        int t = heap.top() / 2;
        sum -= t;
        heap.pop();
        if(t % 2 == 0) heap.push(t);
    }

    cout << sum;
    
    return 0;
}